
import * as arrayExtend from "./array";
import * as dateExtend from "./date";
import * as stringExtend from "./string";

import * as promiseExtend from "./promise";
function defFunction(target, key, v) {
  try {
    Object.defineProperty(target, key, {
      enumerable: false,
      get: function () {
        return v;
      },
    });
  } catch (e) {
    console.log(e);
  }
}
const append = (Ob, extend) => {
  for (const key in extend) {
    if (key.startsWith("_")) {
      defFunction(Ob, key.substring(1), extend[key]);
    } else {
      defFunction(Ob.prototype, key, extend[key]);
    }
  }
};
append(Date, dateExtend);

append(String, stringExtend);

append(Array, arrayExtend);


append(Promise, promiseExtend);
